﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Grishko.SerilizeTools;

namespace Grishko.DataTier.SqlSentence
{
    #region FieldValue
    /// <summary>
    /// Значение поля
    /// </summary>
    [IsNotSrchStorageLinksObject]
    public class WordFieldValue : EntitySingle
    {
        public override string ID // перегружен только чтобы удалить SrchItemInfo
        {
            get
            {
                return base.ID;
            }
            set
            {
                base.ID = value;
            }
        }
        public string Value { get; set; }
        public override string ToString()
        {
            return Value;
        }
    }

    [IsNotSrchStorageLinksObject]
    public class WordFieldValue_Number : WordFieldValue
    {
        new public decimal Value { get; set; }
        public override string ToString()
        {
            return Value.ToString();
        }
    }

    [IsNotSrchStorageLinksObject]
    public class WordFieldValue_NumberBetween : WordFieldValue
    {
        public decimal StartValue { get; set; }
        public decimal EndValue { get; set; }
        public override string ToString()
        {
            return StartValue + ";" + EndValue;
        }

    }

    [IsNotSrchStorageLinksObject]
    public class WordFieldValue_StringBetween : WordFieldValue
    {
        public string StartValue { get; set; }
        public string EndValue { get; set; }
        public override string ToString()
        {
            return StartValue + ";" + EndValue;
        }
    }

    [IsNotSrchStorageLinksObject]
    public class WordFieldValue_Date : WordFieldValue
    {
        public DateTime StartValue { get; set; }

        public override string ToString()
        {
            return StartValue.ToString();
        }
    }

    [IsNotSrchStorageLinksObject]
    public class WordFieldValue_Bool : WordFieldValue
    {
        public bool bValue { get; set; }

        public override string ToString()
        {
            return bValue.ToString();
        }
    }

    [IsNotSrchStorageLinksObject]
    public class WordFieldValue_DateBetween : WordFieldValue
    {
        public DateTime StartValue { get; set; }
        public DateTime EndValue { get; set; }

        public override string ToString()
        {
            return StartValue.ToString("yyyMMdd") + ";" + EndValue.ToString("yyyMMdd");
        }
    }

    [IsNotSrchStorageLinksObject]
    public class WordFieldValue_TreeValue : WordFieldValue
    {
        new public TreeValueProperty Value { get; set; }
        public override string ToString()
        {
            return Value.ToString();
        }
    }

    #endregion
}
